package com.hawthorn.admin.feign.redisService;

import com.hawthorn.admin.model.po.SysDictPO;
import com.hawthorn.platform.config.FeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.FeignFallback;
import org.springframework.cloud.openfeign.HystrixFallbackFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>todo 字典管理Redis</p>
 * @author: andy.ten@tom.com | xukaixing@hotmail.com
 * @created: 2022/7/22 14:07
 * @version v1.0.1
 * @copyright: Copyright (c)  andyten
 */
@FeignClient(name = "sentury-redis", contextId = "dict", path = "/dict", configuration = FeignConfig.class, fallbackFactory = HystrixFallbackFactory.class)
public interface RedisDictFeignService extends FeignFallback
{
  @PostMapping(value = "/saveOrUpdateBatchDict")
  void saveOrUpdateBatchDict(@RequestBody List<SysDictPO> sysDictPO);

  @PostMapping(value = "/syncDictItem")
  void syncDictItem(@RequestBody SysDictPO sysDictPO);

  @PostMapping(value = "/removeDictItem")
  void removeDictItem(@RequestParam String dicType, @RequestParam String dicCode);
}
